<?php

class Application_Form_ChangeMasterPath extends Zend_Form
{
    public function init()
    {
        $this->setMethod('post')
             ->setAttrib('id', 'changeMasterPathForm');

        $this->clearDecorators();

        $decorators = array(
            array('ViewHelper'),
            array('Errors'),
            array('Label', array('requiredSuffix' => ' *', 'class' => 'leftalign')),
            array('HtmlTag', array('tag' => 'li')),
        );

        $path = $this->addElement('textarea', 'path',
            array('label' => 'Selected Path'));
        $path = $this->getElement('path')
                  ->setRequired(true)
                  ->addFilter('StringTrim')
                  ->setAttrib('readonly', 'true');
        $path->setDecorators($decorators);

        $changePath = $this->addElement('submit', 'changePath', array('label' => 'Change Master Path'));
        $changePath = $this->getElement('changePath')
                       ->setDecorators(array(
                        array('ViewHelper'),
        				));
        
        $resetToRoot = $this->addElement('submit', 'resetToRoot', array('label' => 'Reset to Root Folder'));
        $resetToRoot = $this->getElement('resetToRoot')
        				->setDecorators(array(
                       		array('ViewHelper'),
        				));
        
        $this->addDisplayGroup(array('changePath', 'resetToRoot'), 'submit_buttons',
        		array('disableLoadDefaultDecorators' => true));
        $submitButtons = $this->getDisplayGroup('submit_buttons');
        		$submitButtons->addDecorators(array(
        				array('FormElements', 'Form'),
        				array('HtmlTag', array('tag' => 'li', 'class' => 'submit')),
        		));
        
        $this->setDecorators(array(
            'FormElements',
            array('HtmlTag', array('tag' => 'ul')),
            array(array('DivTag' => 'HtmlTag'),
                array('tag' => 'div', 'id' => 'changeMasterPathDiv')),
            'Form'
        ));
    }


}

